#e
#Title[^u̒̊^ Ceւ̓-Easy-v]
#Text[G@LukzKqv]
#ScriptVersion[2]
#PlayLevel[Easy]
#Player[FREE]

script_enemy_main {
 let img = "script\img\ExRumia.png";
 let name = "^u̒̊^ Ceւ̓-Easy-v";

 @Initialize {
  CutIn(KOUMA, name, "", 0, 0, 0, 0);
  SetX(GetCenterX);
  SetY(GetCenterY - 120);
  SetLife(7000);
  SetScore(1000000);

  LoadGraphic(img);
  SetTexture(img);
  SetGraphicRect(64, 0, 128, 64);

  TMain;
 }

 @MainLoop {
  SetCollisionA(GetX, GetY, 24);
  SetCollisionB(GetX, GetY, 24);

  yield;
 }

 @DrawLoop {
  DrawGraphic(GetX, GetY);
 }

 @Finalize {
  DeleteGraphic(img);
 }

 task TMain {
  yield;

  TShot;
  TRadius;
  TRight;
 }

 task TShot {
  yield;
 }

 task TRadius {
  let x = 0;
  let y = 0;
  yield;

  loop {
   loop(1) { yield; }
   SetShotColor(1, 1, 1);
   CreateShot01(GetPlayerX + offsetX(100, x), GetPlayerY + offsetY(100, y), 0.1, atan2(GetPlayerY - (GetPlayerY + offsetY(100, y)), GetPlayerX - (GetPlayerX + offsetX(100, x))) - 180, WHITE11, 0);
   x += 5;
   y += 5;
  }
 }

 task TRight {
  yield;

  loop {
   loop(15) { yield; }
   SetShotColor(244, 244, 244);
   CreateShot01(GetX - 100, GetY, 1, atan2(GetPlayerY - GetY, GetPlayerX - (GetX - 100)), BLUE11, 0);
   CreateShot01(GetX + 100, GetY, 1, atan2(GetPlayerY - GetY, GetPlayerX - (GetX + 100)), RED11, 0);
  }
 }

 function offsetX(radius, mid) {
  return radius * cos(mid);
 }

 function offsetY(radius, mid) {
  return radius * sin(mid);
 }

}